﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;

namespace BarManager.Core.Entity
{
    [DataContract]
    public class Domicilio
    {
        [DataMember]
        public int Id { get; set; }

        [Required]
        [DataMember]
        public int ClienteId { get; set; }

        [Required]
        [DataMember]
        public bool Activo { get; set; }

        [Required]
        [StringLength(150)]
        [DataMember]
        public String Calle { get; set; }

        [Required]
        [Display(Name = "Nro.")]
        [DataMember]
        public int? Numero { get; set; }

        [Display(Name = "Entre Calles")]
        [DataType(DataType.MultilineText)]
        [StringLength(150)]
        [DataMember]
        public string EntreCalles { get; set; }

        [Display(Name = "Depto.")]
        [StringLength(10)]
        [DataMember]
        public string Departamento { get; set; }

        [Display(Prompt = "Piso")]
        [DataMember]
        public int? Piso { get; set; }

        [StringLength(150)]
        [DataMember]
        public string Barrio { get; set; }

        [DataMember]
        public virtual Cliente Cliente { get; set; }

        public override string ToString()
        {
            return string.Format("Calle: {0} Nro:{1} Piso:{2} Depto:{3} Barrio:{4} Entre Calles{5}", Calle, Numero, Piso, Departamento, Barrio, EntreCalles);
        }

        public Domicilio()
        {
            Activo = true;
        }
    }
}
